package com.company.base;

import java.util.Date;

public class Test {
    public static void main(String[] args) {

        System.out.println("----------if的返回----------------------------");
        test01();
        System.out.println("----------else-if的返回----------------------------");
        test02();
        System.out.println("----------return----------------------------");
        test03();

        System.out.println("----------方法重载----------------------------");
        test04();



    }

    /**
     * 方法的重载
     */
    public  static void test04(){
        //创建student类
        Student student = new Student();
        String  str1 = "tjise";
        Date date = new Date();

        /**
        *调用Student的重载方法
         * stu.doStuding("tjise",new Date());//匿名变量
         */


        System.out.println("-------------调用无参数---------------");
        student.doStuding();

        System.out.println("-------------调用char类型的地址参数---------------");
        student.doStuding("天津");

        System.out.println("-------------调用String类型的地址参数---------------");
        student.doStuding("天津");

        System.out.println("-------------调用地址，日期参数---------------");
        //student.doStuding("天津",new Date());//匿名变量
        student.doStuding(str1,date);
        System.out.println(date);

        System.out.println("-------------调用日期，地址参数---------------");
        student.doStuding(new Date(),"天津");

        System.out.println("-------------调用变长参数---------------");
        student.doStuding(new Date(),"tjise","tjpu","tjup");
        student.doStuding(new Date(),new String[]{"tjise","tjpu","tjup"});

        //student.doStuding(new Date(),"tjise");


    }
    /**
     * 最后的返回值
     * @return
     */
    public  static  String test01(){

            int score = 80;
            String strGrade = "";
            if (score>60){
                strGrade = "良好";
            }
            else {
                strGrade = "合格";
            }
            System.out.println("成绩是"+score+"；分数等级是："+strGrade);

            return strGrade;

    }

    /**
     * 每一层的返回值
     * @return
     */
    public static String test02(){
        int score = 45;
        String strGrade = "";
        if (score>=90){
            System.out.println("成绩是"+score+"；分数等级是："+strGrade);
            return "优秀";
        }else if (score>=80){
            System.out.println("成绩是"+score+"；分数等级是："+strGrade);
            return "良好";
        }else  if (score>=60){
            System.out.println("成绩是"+score+"；分数等级是："+strGrade);
         return  "合格";
        }
        else {
            System.out.println("成绩是"+score+"；分数等级是："+strGrade);
           return  "不合格";
        }

    }

    public  static  void test03(){
        System.out.println();
        return;
    }


}
